#ifndef _2_83_FLOAT_GE_H
#define _2_83_FLOAT_GE_H

/**
 * reference from
 * http://lambda.cool/wiki/doku.php?id=answers:csapp:homework-2.83
 */

int float_ge(float x, float y){
    unsigned ux = f2u(x);
    unsigned uy = f2u(y);

    unsigned sx = ux >> 31;
    unsigned sy = uy >> 31;

    return sx == sy ? ( sx ? ux <= uy
                           : ux >= uy )
                    : !sx || ( ux == INT_MIN && uy == 0 );
}

#endif // 2_83_FLOAT_GE_H

